package com.huifaapp.mall.activity.Homefragment.ShengqianActvity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;

import com.huifaapp.mall.R;
import com.huifaapp.mall.activity.LoginActivity;
import com.huifaapp.mall.uitils.GlideImageLoader;
import com.youth.banner.Banner;

import java.util.ArrayList;

public class ShengqianLogingActivity extends AppCompatActivity implements View.OnClickListener {
    private ImageView mGvmineBack;
    private Button button;
    private Banner convenientBanner;
    private ArrayList<Integer> localImages = new ArrayList<Integer>();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_shengqian_loging);
        mGvmineBack = (ImageView) findViewById(R.id.Gvmine_back);
        mGvmineBack.setOnClickListener(this);
        convenientBanner = (Banner) findViewById(R.id.convenientBanner);
        button  = (Button) findViewById(R.id.loging);
        button.setOnClickListener(this);
        localImages.add(R.drawable.hsone);
        localImages.add(R.drawable.hstwo);
        localImages.add(R.drawable.hsthress);
        convenientBanner.setImageLoader(new GlideImageLoader());
        //设置图片集合
        convenientBanner.setImages(localImages);
        //设置自动轮播，默认为true
        convenientBanner.isAutoPlay(true);
        //设置轮播时间
        convenientBanner.setDelayTime(1500);
        convenientBanner.start();




    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.Gvmine_back:
                finish();
                break;
            case R.id.loging:
                Intent intent = new Intent(ShengqianLogingActivity.this, LoginActivity.class);
                startActivity(intent);
                finish();
                break;

        }

    }
}
